<?php
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers');
include 'includes/viewitem.php';

?>

<?php if ($params->get('show_create_date') || $params->get('show_author')|| $params->get('show_category')) : ?>
<div class="itemInfo">
	<?php if ($params->get('show_create_date')) : ?>
    <span class="itemDate"><?php echo JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC2')); ?></span>
    <?php endif;?>
    <?php if ($params->get('show_category')) : ?>
    <span class="itemCat"><?php 	$title = $this->escape($this->item->category_title);
	$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
	<?php if ($params->get('link_category') AND $this->item->catslug) : ?>
		<?php echo JText::sprintf($url); ?>
	<?php else : ?>
		<?php echo JText::sprintf($title); ?>
	<?php endif; ?></span>
    <?php endif;?> 
    <?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
    <span class="itemAuthor"><?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
	<?php if (!empty($this->item->contactid) && $params->get('link_author') == true): ?>
	<?php
		$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
		$item = JSite::getMenu()->getItems('link', $needle, true);
		$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
	?>
		<?php echo JText::sprintf(JHtml::_('link', JRoute::_($cntlink), $author)); ?>
	<?php else: ?>
		<?php echo JText::sprintf($author); ?>
	<?php endif; ?></span>
    <?php endif;?>   
</div>
<?php endif;?>	
<?php if(($cf_gallery_display)==1):?>
<div id="itemGallery">
<?php echo $this->loadTemplate('itemgallery');?>
</div>
<?php endif;?>

<?php if ($params->get('show_hits') || $params->get('show_modify_date')) : ?>
<div class="itemSubInfo">	
    <?php if ($params->get('show_modify_date')) : ?>
	<span class="itemEdit fR"><?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?></span>    
	<?php endif; ?>
    <?php if ($params->get('show_hits')) : ?>
	<span class="itemHits"><?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?></span>
    <?php endif;?>	
</div>
<?php endif; ?>	

<?php if($customdata->get('cf_tags_display') !=0) :?>
<div class="itemTags">	
	<?php for($i=0; $i<sizeof($tags); $i++) { ;?>
			<span><?php if($customdata->get('cf_tags_display')==2):?>
            	<a href="#"><?php echo $tags[$i];?></a>
            	<?php else :?>   
                <?php echo $tags[$i];?>
                <?php endif;?> 
            </span>
		<?php };?>
</div>
<?php endif;?>

<?php if($backtotop_display):?>
<div class="itemBack">
	<a href="#anchorItem<?php echo JRequest::getInt('id'); ?>">Back to top</a>
</div>
<?php endif;?>

